package com.codeman.business.crawl.domain;


import com.codeman.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 爬虫源对象 crawl_source
 *
 * @author ruoyi
 * @date 2021-03-19
 */
@Data
public class CrawlSource {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Integer id;

    /**
     * 源站名
     */
    private String sourceName;

    /**
     * 爬取规则（json串）
     */
    private String crawlRule;

    /**
     * 爬虫源状态，0：关闭，1：开启
     */
    @Excel(name = "爬虫源状态，0：关闭，1：开启")
    private String sourceStatus;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("sourceName", getSourceName())
                .append("crawlRule", getCrawlRule())
                .append("sourceStatus", getSourceStatus())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
